import { axios } from '@/utils/request'

const api = {
  teacher: '/system/teacher'
}

export function getTcTeacherList (parameter) {
  return axios({
    url: api.teacher + '/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 无分页列表
 * @param {Object} parameter
 */
export function getTeacherList (parameter) {
  return axios({
    url: api.teacher + '/jlist',
    method: 'get',
    params: parameter
  })
}

export function saveTcTeacher (parameter) {
  return axios({
    url: api.teacher + (parameter.teacherId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delTcTeacher (parameter) {
  return axios({
    url: api.teacher + '/remove',
    method: 'post',
    params: parameter
  })
}

export const teacherExport = api.teacher + '/export'
